<?php

class FluentFormsTest extends HomeController {

    public function GET_index() {
        require_once 'app/lib/FluentForms/FluentForms.php';

        header('Content-type: text/html; charset=UTF-8');

        $form = new FluentForm();

        $form->action('user/reset#tab_users');

        $form
                ->hidden('id_user', 100)
                ->hidden('account', 'Sirh');

        $form->fieldset('user')
                ->textbox('user_name', 'Lecouteux')->label('Nom')
                ->textbox('user_firstname', 'Vincent')->label('Prénom');

        $form->fieldset('credentials')
                ->textbox('login_visu_update', 'vince')->label('Login')
                ->attributes('size', 20)
                ->attributes('maxlength', 20)
                ->attributes('required', true)
                /* ->attributes('readonly', true) */
                ->attributes('autocomplete', AUTOCOMPLETE)
                ->attributes('onblur', 'checkLogin(this)')
                ->void()
                ->textbox('pwd_visu_update', 'yannyann', TRUE)->label('Mot de passe');

        $form->fieldset('manager')
                ->textbox('user_manager_name', 'Bigoud')->label('Nom')
                ->textbox('user_manager_firstname', 'Zoé')->label('Prénom');

        foreach ($form->conf as $key => $value) {
            var_dump($key);
            var_dump($value);
            echo "<hr>";
        }
    }

}
